import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Page;
import 'package:flutter/services.dart';
import 'package:flutter_demo/login/page.dart';
import 'package:flutter_demo/pages/brand_page/detail_page/barand_detail.dart';
import 'package:flutter_demo/routes.dart';
import 'login/login_phone/page.dart';
import 'login/login_verify/page.dart';
import 'package:flutter_demo/pages/brand_page/page.dart';
import 'package:flutter_demo/pages/find_page/page.dart';
import 'package:flutter_demo/pages/home_page/page.dart';
import 'package:flutter_demo/pages/task_page/page.dart';
import 'package:flutter_demo/pages/user_page/page.dart';

void main() {
  SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  runApp(createApp());
}

Widget createApp() {
  // ///定义路由
  // final AbstractRoutes routes = PageRoutes(
  //   pages: <String, Page<Object, dynamic>>{
  //     ///页面传值跳转模块
  //     "LoginPage": LoginMainPage(),
  //     'login_phone': LoginPhonePage(),
  //     'login_verify':LoginVerifyPage(),
  //     'home_page':HomePage(),
  //     'brand_page':BrandPage(),
  //     'task_page':TaskPage(),
  //     'find_page':FindPage(),
  //     'user_page':UserPage()
  //   },
  // );

  return MaterialApp(
    debugShowCheckedModeBanner: false,
    title: 'Flutter Demo',
    theme: ThemeData(
      primarySwatch: Colors.blue,
    ),
    home: routes.buildPage("LoginPage", null),
    onGenerateRoute: (RouteSettings settings) {
      return MaterialPageRoute(builder: (BuildContext context) {
        return routes.buildPage(settings.name, settings.arguments);
      });
    },
      routes: {
        'custom_page':(context)=>CustomPage(),
      }
  );
}
